/**
 * 
 */
package org.arpit.masteringextjs.jsonserializer;

import java.io.IOException;

import org.arpit.masteringextjs.domain.Language;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;

/**
 * @author arpit
 *
 */
public class LanguageToIdSerializer extends JsonSerializer<Language>{

	@Override
	public void serialize(Language value, JsonGenerator jsonGenerator,
			SerializerProvider arg2) throws IOException,
			JsonProcessingException {
		jsonGenerator.writeObject(value.getId().toString());
	}

}
